package datasv.teacherQuery_datasv;

import java.sql.Date;

import po.TeacherPO;
import resultmessage.StudentQueryRM;
import resultmessage.TeacherQueryRM;

public class UpdateTeacher {
	public static void main(String[] args) {
		System.out.println(new UpdateTeacher().updateTeacher(new TeacherPO("001132003", "testTEacher", "001", 2014, new Date(1993,03,23))));
	}
	public TeacherQueryRM updateTeacher(TeacherPO po){
		return updateInSql(po);
	}
	private TeacherQueryRM updateInSql(TeacherPO po){
		TeacherQueryRM tr=new DeleteTeacher().deleteTeacher(po.getTeacherID());
		if(!tr.equals(TeacherQueryRM.SUCCESS)){
			return tr;
		}
		tr=new AddTeacher().addTeacher(po);
		return tr;
	}
}
